package com.example.springevent.event.async;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

import com.example.springevent.event.bo.IvdAddedEventBO;
import com.example.springevent.event.event.IvdAddedEvent;
import com.example.springevent.ivd.domain.InvoiceKey;

//@Component
public class IvdAddedEventInvoiceAsyncListener implements ApplicationListener<IvdAddedEvent> {

	private static final Logger log = LoggerFactory.getLogger(IvdAddedEventInvoiceAsyncListener.class);

	@Async
	@Override
	public void onApplicationEvent(IvdAddedEvent event) {
		IvdAddedEventBO ivd = event.getIvdAddedEventBO();
		log.info("Thread = [{}],发票[{}]增加核销金额[{}]",Thread.currentThread().getName(), new InvoiceKey(ivd.getInvoiceCode(), ivd.getInvoiceNo()), ivd.getVerifyAmt());
	}

}
